class LoginPage(object):
    def __init__(self, username, password, code):
        self.username = username
        self.password = password
        self.code = code

    def liick_button(self):
        print("登录成功")

    def __str__(self):
        return "这是后台的测试数据"


log1 = LoginPage("admin", "123456", "8888")

print(log1)  # 没有__str__()时,打印结果为内存地址:<__main__.LoginPage object at 0x00000270DCCF91D0>
print(log1)  # 有__str__()时,能够显示自定义的对象信息
